home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1998 / MacHack 1998.toast / The Hacks! / mhTV ƒ / TVSource / 1BuildTVImport.ts < prev    next >
Text File  |  1998-06-20  |  3KB  |  74 lines

  1. ###=============================================================================
  2. # STEP (1) Compile all the files into a directory full of xcoffs.
  3. ###=============================================================================
  4.  
  5. #This directory stores temp files and can be trashed when we're done.
  6. Set XCOFF_DIR "{TEMP_ROOT}(PPC_TVImport.π XCOFF):"
  7.  
  8. ###-----------------------------------------------------------------------------
  9.  
  10. If `Exists "{XCOFF_DIR}"`
  11.     Delete -y "{XCOFF_DIR}"
  12. End
  13. NewFolder "{XCOFF_DIR}"
  14.  
  15. ###-----------------------------------------------------------------------------
  16.  
  17. Set SOURCE "{IMPORT_ROOT}TVImportComponent.c"
  18. Set DESTINATION "{XCOFF_DIR}TVImportComponent.c.o"
  19. mrc {C_OPTIONS} "{SOURCE}" -o "{DESTINATION}" {H_DIRS}
  20.  
  21. ###-----------------------------------------------------------------------------
  22.  
  23. Echo "#  Compiles done"
  24.  
  25. ###=============================================================================
  26. # STEP (2) Link.
  27. ###=============================================================================
  28.  
  29. #The -mf flag below tells PPCLink to use MultiFinder temp mem as appropriate.
  30. #The -m flag sets the entry point to the UPP we have created in the source.
  31. #The -codeorder flag tries to order the code in the file in a vaguely useful
  32. # fashion as regards paging and TLB usage.
  33. Set LINK_OPTIONS "-warn -codeorder staticcall -mf -m ImportTVSelectorDispatcher"
  34. Set DESTINATION "{XCOFF_DIR}PPC_TVImport.π.pef"
  35.  
  36. #We have to screw around with changing the current directory to get the 
  37. #<files> command to work.
  38. Set temp_dir `Directory`
  39. Directory "{XCOFF_DIR}"
  40.   PPCLink {LINK_OPTIONS} `files ≈.o` {LIBRARIES} -o "{DESTINATION}"
  41. Directory "{temp_dir}"
  42. Echo "#  Link done"
  43.  
  44. ###=============================================================================
  45. # STEP (3) Run MrPlus on the PEF.
  46. ###=============================================================================
  47.  
  48. Set SOURCE "{XCOFF_DIR}PPC_TVImport.π.pef"
  49. Set FINAL_PEF "{XCOFF_DIR}PPC_TVImport.π.pef.opt"
  50. If {USE_MR_PLUS}
  51.     MrPlus -opt static "{SOURCE}" 
  52. Else
  53.     Duplicate -y "{SOURCE}" "{FINAL_PEF}"
  54. End
  55.  
  56. ###=============================================================================
  57. # STEP (4) Convert the PEF to a resource and add other resources.
  58. ###=============================================================================
  59.  
  60. Set FINAL_PEF "{XCOFF_DIR}PPC_TVImport.π.pef.opt"
  61. Set SOURCE "{IMPORT_ROOT}BuildTVImport.r"
  62. Set DESTINATION "{OUTPUT_ROOT}TV Import Component"
  63. Export FINAL_PEF
  64. Rez "{SOURCE}" -o "{DESTINATION}"
  65.  
  66. ###=============================================================================
  67. # STEP (6) Convert the output to the right type of file.
  68. ###=============================================================================
  69.  
  70. Setfile "{DESTINATION}" -t THNG -c RNST
  71. Echo "#  Import done"
  72.  
  73. ###=============================================================================
  74.